package fr.sportcom.sportcom.model;

import android.os.Parcel;
import android.os.Parcelable;

public class CSport implements Parcelable {
	
	private String name;
	private int id;

	public CSport(int id, String name) 
	{
		this.id = id;
		this.name = name;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	@Override
	public int describeContents() {
		return 0;
	}

	@Override
	public void writeToParcel(Parcel dest, int flags) {
		dest.writeInt(this.id);
		dest.writeString(this.name);
	}

	public static final Parcelable.Creator<CSport> CREATOR = new Parcelable.Creator<CSport>() {
		@Override
		public CSport createFromParcel(Parcel source)
		{
			return new CSport(source);
		}

		@Override
		public CSport[] newArray(int size)
		{
			return new CSport[size];
		}
	};

	public CSport(Parcel in) {
		this.id = in.readInt();
		this.name = in.readString();
	}

}
